#define _CRT_SECURE_NO_WARNINGS 1

#include <vector>

using namespace std;

struct TreeNode {
    int val;
    TreeNode* left;
    TreeNode* right;
    TreeNode() : val(0), left(nullptr), right(nullptr) {}
    TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
    TreeNode(int x, TreeNode* left, TreeNode* right) : val(x), left(left), right(right) {}
    
};

class Solution {
public:
    vector<int> inorderTraversal(TreeNode* root) {
        vector<int> v1;
        _inorderTraversal(root, v1);
        return v1;
    }
    void _inorderTraversal(TreeNode* root, vector<int>& v1)
    {
        if (root == NULL)
            return;
        _inorderTraversal(root->left, v1);
        v1.push_back(root->val);
        _inorderTraversal(root->right, v1);
    }
};